package 笔试.A网易;

import java.util.Scanner;

public class first {
    
    
    public static void main(String[] args){//main--来自高金磊
         Scanner scanner=new Scanner(System.in);
         char[] chars=scanner.next().toCharArray();
         int[][] data=new int[chars.length][2];
         //DP
        for (int i = 1; i < chars.length; i++) {
            if (Math.abs(chars[i]-chars[i-1])<=1){
                data[i][1]=Math.max(data[i-1][0],data[i-1][1]);
                data[i][0]=Math.max(data[i-1][1]+(chars[i]+chars[i-1]-'a'-'a'+2),data[i-1][0]);

            }
            else {
                data[i][0]=Math.max(data[i-1][0],data[i-1][1]);
                data[i][1]=Math.max(data[i-1][0],data[i-1][1]);
            }
        }
        System.out.println(""+Math.max(data[data.length-1][0],data[data.length-1][1]));


    }


}
